import request from '@/utils/request'

/**
 * 
 * @param {可视化数据接口} data 
 * @returns 
 */

//可视化数据分页查询
export const getList = (data) => {
  return request({
    url: '/visual-data/selectByCondition?currentPage=' + data.currentPage + '&size=' + data.size+'&visualName='+data.visualName,
    method: 'get'
  })
}

//获取选中原始数据列的字段
export const getColumns = (data) => {
  return request({
    url: '/original-data/selectColumns?ids=' + data,
    method: 'get'
  })
}

//回显原始数据选中列
export const selectByIds = (data) => {
  return request({
    url: '/original-data/selectByIds?ids=' + data,
    method: 'get'
  })
}

//新增可视化数据
export const insertVisual = (data) => {
  return request({
    url: '/visual-data/insert',
    method: 'post',
    data
  })
}

//新增查询可视化名称重命名效验
export const insertRules = (data) => {
  return request({
    url: '/visual-data/existsVisualName?visualName='+data,
    method: 'get',
  })
}

//查询可视化数据详情
export const selectOne = (data) => {
  return request({
    url: '/visual-data/selectOne?id='+data.id,
    method: 'get',
  })
}

//编辑可视化数据
export const updateVisual = (data) => {
  return request({
    url: '/visual-data/updateByCondition',
    method: 'post',
    data
  })
}

//批量删除可视化数据
export const delateVisual = (data) => {
  return request({
    url: '/visual-data/batchDelete',
    method: 'post',
    data
  })
}
